package com.moody.hibernate.domain;

import java.text.DecimalFormat;

/**
 * RatioValue entity. @author MyEclipse Persistence Tools
 */

public class RatioValue implements java.io.Serializable {

	// Fields

	private RatioValueId id;
	private Double reportItemValue;
	private Double itemValue;
	private Double itemWeight;
    private String itemDescription;
    private String describe;
    private String itemValueString;
    private String reportItemValueString;
	// Constructors

	/** default constructor */
	public RatioValue() {
	}

	/** minimal constructor */
	public RatioValue(RatioValueId id) {
		this.id = id;
	}

	/** full constructor */
	public RatioValue(RatioValueId id, Double reportItemValue,
			Double itemValue, Double itemWeight) {
		this.id = id;
		this.reportItemValue = reportItemValue;
		this.itemValue = itemValue;
		this.itemWeight = itemWeight;
	}

	// Property accessors

	public RatioValueId getId() {
		return this.id;
	}

	public void setId(RatioValueId id) {
		this.id = id;
	}

	public Double getReportItemValue() {
		return this.reportItemValue;
	}

	public void setReportItemValue(Double reportItemValue) {
		DecimalFormat df = new DecimalFormat("###,##0.00");
		if(reportItemValue!=null){
			reportItemValueString = String.valueOf(df.format(reportItemValue)); 
			
		}
		this.reportItemValue = reportItemValue;
	}

	public Double getItemValue() {
		return this.itemValue;
	}

	public void setItemValue(Double itemValue) {
		this.itemValue = itemValue;
		DecimalFormat df = new DecimalFormat("###,##0.00");
		if(itemValue!=null){
			itemValueString = String.valueOf(df.format(itemValue)); 
			
		}
	}

	public Double getItemWeight() {
		return this.itemWeight;
	}

	public void setItemWeight(Double itemWeight) {
		this.itemWeight = itemWeight;
	}

	public String getItemDescription() {
		return itemDescription;
	}

	public void setItemDescription(String itemDescription) {
		this.itemDescription = itemDescription;
	}

	public String getDescribe() {
		return describe;
	}

	public void setDescribe(String describe) {
		this.describe = describe;
	}

	public String getItemValueString() {
		return itemValueString;
	}

	public void setItemValueString(String itemValueString) {
		this.itemValueString = itemValueString;
		if(itemValueString != null)
			itemValueString = itemValueString.replaceAll(",","");  
			this.itemValue = Double.valueOf(itemValueString);
	}

	public String getReportItemValueString() {
		return reportItemValueString;
	}

	public void setReportItemValueString(String reportItemValueString) {
		this.reportItemValueString = reportItemValueString;
		if(reportItemValueString != null)
			reportItemValueString = reportItemValueString.replaceAll(",", "");
		this.reportItemValue = Double.valueOf(reportItemValueString);
	}
	

}